Make this function return NULL if GDK could not be
initialized. We check this by seeing if there is a
display manager singleton.
*
* Opens the default display specified by command line arguments or
* environment variables, sets it as the default display, and returns
- * it. gdk_parse_args must have been called first. If the default
+ * it. gdk_parse_args() must have been called first. If the default
* display has previously been set, simply returns that. An internal
* function that should not be used by applications.
*
g_return_val_if_fail (gdk_initialized, NULL);
+ if (gdk_display_manager_peek () == NULL)
+ return NULL;
+
display = gdk_display_get_default ();
if (display)
return display;